package com.qf.purchase.service;

import com.github.pagehelper.PageInfo;
import com.qf.purchase.dao.FirmDao;
import com.qf.purchase.po.Brand;
import com.qf.purchase.po.Firm;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class FirmServiceImpl implements FirmService{
    @Resource
    private FirmDao firmDao;

    @Override
    public boolean addFirm(Firm firm) {
        boolean f = firmDao.addFirm(firm)>0?true:false;
        return f;
    }

    @Override
    public PageInfo<Firm> getAllFirmByPage(Map params) {
        List<Firm> firmList= firmDao.getAllFirmByPage(params);
        PageInfo<Firm> pageInfo = new PageInfo<Firm>(firmList);
        return pageInfo;
    }

    @Override
    public boolean updateFirm(Firm firm) {
        return firmDao.updateFirm(firm)>0;
    }

    @Override
    public Firm findFirmById(int id) {
        return firmDao.findFirmById(id);
    }
}
